package com.graduation.system.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.validator.constraints.NotEmpty;

@Entity
@Table(name = "SYS_DEPARTMENT")
@DynamicInsert(true)
@DynamicUpdate(true)
public class SysDepartment {

	private Integer depId; // 部门id，唯一，自增长，主键
	private String depName; // 部门名称，唯一
	private String depIcon; //部门图标
	private Byte status; //状态
	private java.sql.Timestamp createTime;//创建时间
	
	@Id
	@Column(name = "DEP_ID", nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Integer getDepId() {
		return depId;
	}
	public void setDepId(Integer depId) {
		this.depId = depId;
	}
	@NotEmpty(message="部门名称不能为空！")
	@Column(name = "DEP_NAME", nullable = false)
	public String getDepName() {
		return depName;
	}
	public void setDepName(String depName) {
		this.depName = depName;
	}
	@Column(name = "DEP_ICON")
	public String getDepIcon() {
		return depIcon;
	}
	public void setDepIcon(String depIcon) {
		this.depIcon = depIcon;
	}
	@Column(name = "STATUS", nullable = false, columnDefinition = "tinyint default 0")
	public Byte getStatus() {
		return status;
	}
	public void setStatus(Byte status) {
		this.status = status;
	}
	@Column(name = "CREATE_TIME", columnDefinition = "timestamp default CURRENT_TIMESTAMP")
	public java.sql.Timestamp getCreateTime() {
		return createTime;
	}
	public void setCreateTime(java.sql.Timestamp createTime) {
		this.createTime = createTime;
	}
}
